class bigint{
private:
    string rnum;
    int size;
public:

    void delete_pre_zero(string &znum) { //删除正序数字的前导0
        int pos=0;
        for (int i=0;i<znum.size();i++) {
            if (znum[i]-'0') {
                break;
            }else {
                pos++;
            }
        }

        znum=znum.substr(pos);
    }

    bigint operator*(const long long p){ //重载乘号
        long long z=0;
        string ans;
        for(int i=0;i<rnum.size();i++){
            ll num=(rnum[i]-'0')*p;
            num+=z;
            z=num/10;
            num%=10;
            ans+=num+'0';
        }

        while(z){
            ans+=z%10+'0';

            z/=10;
        }

        reverse(ans.begin(),ans.end());
        return bigint(ans);
    }

    bigint operator/(const int p) { //重载除号
        ll remainder=0;
        string ans;

        string num(rnum.rbegin(),rnum.rend());
        ll curr=0;
        for (int i=0;i<num.size();i++) {
            curr*=10;
            curr+=num[i]-'0';
            ans+=curr/p+'0';
            curr%=p;
        }
        delete_pre_zero(ans);

        return bigint(ans);
    }

    bool operator<(const bigint &other) const { //重载小于符号
        if (size!=other.size) {
            return size<other.size;
        }

        string num1=out();
        string num2=other.out();
        return num1<num2;
    }

    bigint(string str) { //带参构造
        rnum=str;
        delete_pre_zero(rnum); //先删去正序数字时的前导0
        size=rnum.size();

        if (size==0) { //数字就是为0
            size=1;
            rnum="0";
        }
        
        reverse(rnum.begin(),rnum.end());
    }

    bigint(){
        size=1;
        rnum="0";
    }

    string out() const {
        string num(rnum.rbegin(),rnum.rend());
        return num;
    }

    friend ostream &operator<<(ostream& os,const bigint &num){ //重载左移符号
        os<<num.out();
        return os;
    }
};